﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AGameOfThrones.house
{
    /// <summary>
    /// Interaction logic for house.xaml
    /// </summary>
    public partial class house : UserControl
    {
    
        public house()
        {
            InitializeComponent();
        }

        public ui.manager UIManager
        {
            get
            {
                try
                {
                    return System.Windows.Application.Current.FindResource("uimanager") as ui.manager;
                }
                catch (System.Exception ex)
                {
                    Console.WriteLine(ex);
                    return null;
                }

            }
        } 

        private void house_control_Loaded(object sender, RoutedEventArgs e)
        {
            OrderTokens.Panel.Name = HouseName.Text + "_OrderTokens";
            SpecialTokens.Panel.Name = HouseName.Text + "_SpecialTokens";
            PowerTokens.Panel.Name = HouseName.Text + "_PowerTokens";
            Units.Panel.Name = HouseName.Text + "_Units";

            UIManager.Panels.Add(OrderTokens.Panel.Name, OrderTokens.Panel);
            UIManager.Panels.Add(SpecialTokens.Panel.Name, SpecialTokens.Panel);
            UIManager.Panels.Add(PowerTokens.Panel.Name, PowerTokens.Panel);
            UIManager.Panels.Add(Units.Panel.Name, Units.Panel);
        }
    }
}
